package log;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Date;

public class LogTask implements Runnable {

    Log log;
    private String username;
    private String msg;

    public LogTask(Log log, String username, String msg) {
        this.log = log;
        this.username = username;
        this.msg = msg;
    }




    @Override
    public void run() {
        if (log instanceof RunLog) {
            RunLog runLog = (RunLog) log;
            runLog.log(username,msg);
        } else if (log instanceof LoginLog) {
            LoginLog loginLog = (LoginLog) log;
            loginLog.log(username,msg);
        }


    }


}
